package com.punai.config.sqlitedomain;


import cn.hutool.core.util.StrUtil;
import com.punai.config.sqlitedomain.basic.SqliteEntity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Template extends SqliteEntity {
    private String id;
    private String type;
    private String name;
    private String code;
    private String departCode;
    private Date createDate;
    private Integer editState;
    private Date lastModify;
    private String sreachKey;
    private Integer version;
    private String individualEngineeringType;
    private String costsType;

    private String typeName;

    private String copyId;

    private List<Structure> children = new ArrayList<>();

  public List<Structure> getChildren() {
    return children;
  }

  public void setChildren(List<Structure> children) {
    this.children = children;
  }

  public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.typeName= StrUtil.equals("0", type) ? "收入指标" : "成本指标";
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDepartCode() {
        return StrUtil.isBlank(departCode) ? "" : departCode;
    }

    public void setDepartCode(String departCode) {
        this.departCode = departCode;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Integer getEditState() {
        return editState;
    }

    public void setEditState(Integer editState) {
        this.editState = editState;
    }

    public Date getLastModify() {
        return lastModify;
    }

    public void setLastModify(Date lastModify) {
        this.lastModify = lastModify;
    }

    public String getSreachKey() {
        return sreachKey;
    }

    public void setSreachKey(String sreachKey) {
        this.sreachKey = sreachKey;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getIndividualEngineeringType() {
        return individualEngineeringType;
    }

    public void setIndividualEngineeringType(String individualEngineeringType) {
        this.individualEngineeringType = individualEngineeringType;
    }

    public String getCostsType() {
        return costsType;
    }

    public void setCostsType(String costsType) {
        this.costsType = costsType;
    }

    public String getTypeName() {
        return StrUtil.equals("0",type)?"收入指标":"成本指标";
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getCopyId() {
        return copyId;
    }

    public void setCopyId(String copyId) {
        this.copyId = copyId;
    }

    @Override
    public String toString() {
        return "Template{" +
                "id='" + id + '\'' +
                ", type='" + type + '\'' +
                ", name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", departCode='" + departCode + '\'' +
                ", createDate=" + createDate +
                ", editState=" + editState +
                ", lastModify=" + lastModify +
                ", sreachKey='" + sreachKey + '\'' +
                ", version=" + version +
                ", individualEngineeringType='" + individualEngineeringType + '\'' +
                ", costsType='" + costsType + '\'' +
                ", typeName='" + typeName + '\'' +
                '}';
    }
}
